/*=============================================================================

CUSTIOM APPLICATION MAIN

FILE: Cust_App.c

DESCRIPTION

Cust Application Main Module

REMARK
 * This module is for the application instance handling

  Copyright (c) DaeSung Engineering Inc. All rights reserved.

=============================================================================*/
/*=============================================================================

EDIT HISTORY

---------  -------  -------------------------------------------------------
when       who      what, where, why
---------  -------  -------------------------------------------------------
08/16/02   phkim    Initial version

=============================================================================*/

#include "stdafx.h"
#include <Cust_App.h>
#include <mainFrm.h>

//=============================================================================
// LOCALIZED VARIABLES
//=============================================================================

/////////////////////////////////////////////////////////////////////////////
// CCust_App

BEGIN_MESSAGE_MAP(CCust_App, CWinApp)
	//{{AFX_MSG_MAP(CCust_App)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CCust_App construction

CCust_App::CCust_App()
{
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CCust_App object

CCust_App theApp;

/////////////////////////////////////////////////////////////////////////////
// CCust_App initialization

BOOL CCust_App::InitInstance()
{
	if(SYS_INIT(m_lpCmdLine) == FALSE)
	{
		return	FALSE;
	}

	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

	// Change the registry key under which our settings are stored.
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization.
	//SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	// To create the main window, this code creates a new frame window
	// object and then sets it as the application's main window object.
	CMainFrame* pFrame = new CMainFrame;
	m_pMainWnd = pFrame;

#ifdef TG_UI_MENU
	// create and load the frame with its resources
	pFrame->LoadFrame(IDR_MENU1,
		WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE, NULL,
		NULL);
	// The one and only window has been initialized, so show and update it.
	//pFrame->ShowWindow(SW_SHOW);
	pFrame->UpdateWindow();
#else
	if(!pFrame->WindowCreate(UIsize_TBL(UISIZE_SCRN_X), UIsize_TBL(UISIZE_SCRN_Y), \
		UIsize_TBL(UISIZE_SCRN_W), UIsize_TBL(UISIZE_SCRN_H), NULL))
	{
		return	FALSE;
	}
	pFrame->ActivateFrame();
	pFrame->ShowWindow(SW_SHOW);
#endif

	return TRUE;
}

int CCust_App::ExitInstance() 
{
	SYS_CLOSE();

	return CWinApp::ExitInstance();
}
